﻿using Sys.Core.Sys;
using Sys.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class admin_sys_menu_Edit : System.Web.UI.Page
{
    public SysMenu model { get; set; }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string id = Request.QueryString["id"];
            string pid = Request.QueryString["pid"];

            if (string.IsNullOrEmpty(id))
            {
                model = new SysMenu();

                if (!string.IsNullOrEmpty(pid))
                {
                    model.Parent = pid;
                }
                model.Type = "Null";
            }
            else { model = MenuBll.I.GetByKey(id); }

            if (string.IsNullOrEmpty(model.Parent)) { model.Parent = "Null"; }
        }
    }
}